<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2017/12/12
  Time: 22:57
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <jsp:include page="/WEB-INF/jsp/head.jsp">
        <jsp:param value="卖分" name="pageTitle"/>
    </jsp:include>
</head>
<body>
<div title="游戏卖分" class="easyui-panel" data-options="fit:true,iconCls:'icon-application-view-detail'" style="padding: 4px;">
    <form id="sellingScoreF" action="/dealTable/sellingScore" method="post">
        <table class="yj-table2" cellpadding="0" cellspacing="0">

            <tr>
                <td style="width: 100px;"><strong>交易的游戏：</strong></td>
                <td>
                    <div id="Game">
                        <select id="gid" class="yj-select gid" name="gid" ></select>
                        <span class="msg-box" for="gid" style="position:absolute;"></span>
                    </div>
                </td>


                <td style="width: 100px;"><strong>游戏账号：</strong></td>
                <td>
                    <div id="GameAcc">
                        <select id="aid" class="yj-select aid" name="aid" ></select>
                        <span class="msg-box" for="aid" style="position:absolute;"></span>
                    </div>
                </td>

            </tr>
            <tr>
                <td><strong>卖出多少分：</strong></td>
                <td>
                    <input class="yj-text" type="text" id="sellingscore" name="sellingscore" style="width: 100px;"/>
                </td>
                <td style="width: 100px;"><strong>银行卡：</strong></td>
                <td>
                    <div id="Bank">
                        <select id="bid" class="yj-select bid" name="bid" data-value=""></select>
                        <span class="msg-box" for="bid" style="position:absolute;"></span>
                    </div>
                </td>

            </tr>
            <tr>
                <td><strong>送出多少分：</strong></td>
                <td>
                    <input class="yj-text" type="text" id="giftscore" name="giftscore" value="0" style="width: 100px;"/>
                </td>
            </tr>
            <tr>
                <td><strong>帮忙敲分：</strong></td>
                <td>
                    <input class="yj-text" type="text" id="helpscore" name="helpscore" value="0" style="width: 80px;"/>
                </td>
                <td><strong>被帮助者的名字：</strong></td>
                <td>
                    <div id="User">
                        <select id="helpeduid" class="yj-select helpeduid" name="helpeduid" ></select>
                        <span class="msg-box" for="helpeduid" style="position:absolute;"></span>
                    </div>
                </td>
            </tr>
            <tr>
                <td><strong>备注：</strong></td>
                <td>
                     <textarea class="yj-textarea" id="remark" name="remark" data-toggle="autoheight"
                               cols="90" rows="6" maxlength="300" style="width:350px;height:180px;"
                               placeholder="字数控制在300字以内"></textarea>
                </td>
                <td><strong>操作者：</strong></td>
                <td>
                    <input class="yj-text" type="text" id="handlers" name="handlers" style="width: 80px;"
                           value="${userRName}" readonly="readonly"/>
                    <input  type="hidden" id="handlerid" name="handlerid"
                            value="${userID}" />
                </td>
            </tr>
            <tr>
                <td colspan="4">
                    <button type="submit" class="easyui-linkbutton">
                        <i class="fa fa-save"></i>&nbsp;保存
                    </button>
                </td>
            </tr>
        </table>
    </form>
</div>
<script>
    //游戏下拉框生成
    $('#Game').cxSelect({
            url: '/games/getAllNo',
            selects: ['gid'],
            emptyStyle: 'none',
            jsonName: 'gname',
            jsonValue: 'gid'
        }
    );
    $('#Game').change(function(){
        //游戏账号下拉框
        $('#GameAcc').cxSelect({
                    url: '/gameAccount/getAllByGid?gid='+$("#gid").val(),
                    selects: ['aid'],
                    emptyStyle: 'none',
                    jsonName: 'accountnum',
                    jsonValue: 'aid'
                }
        );
        //银行卡下拉框
        $('#Bank').cxSelect({
                    url: '/bankCard/getAllByGid?gid='+$("#gid").val(),
                    selects: ['bid'],
                    emptyStyle: 'none',
                    jsonName: 'alias',
                    jsonValue: 'bid'
                }
        );
    });

    //被帮助者选择
    $('#User').cxSelect({
            url: '/user/getAll',
            selects: ['helpeduid'],
            emptyStyle: 'none',
            jsonName: 'relname',
            jsonValue: 'uid'
        }
    );


    $("#sellingScoreF").validator({
        theme: "yellow_right",
        fields: {
            gid: {
                rule: "required;"
            },
            adid: {
                rule: "required;"
            },
            bid: {
                rule: "required;"
            },
            sellingscore: {
                rule: "required;length(~15);decimal"
            },
            shift: {
                rule: "required;decimal;"
            }
        }, valid: function (form) {
            $(form).form('submit', {
                success: function (data) {
                    var newdata =JSON.parse(data);
                    $.messager.alert('提示信息', newdata['msg'], 'info', function () {
                        //跳转地址
                        location.href = "/dataQuery/normalDealQuery";
                    });
                    $('.panel-tool-close').hide();//隐藏关闭按钮
                }
            });
        }
    });


</script>
</body>
</html>
